

(function() {
  getPageData();
})();



page.date = 0;
page.dateClass = 0;
page.page = 1;
page.pageCount = 0;
page.pageSize = 12;

function getPageData() {
  getJson(Domain + '/mbr/doSearchMbrGoodsTrackList.do', {
    page: page.page,
    pageSize: page.pageSize
  }, function(data) {
    page.pageCount = data.data.pageCount;
    var rows = data.data.rows;
    page.date = null;
    if (rows.length == 0 && page.page == 1) {
      $('#goods_item').html('<div class="noDataInfo">暂无足迹</div>');
    }
    for (var i = 0; i < rows.length; i++) {
      var date;
      if (rows[i].viewDate != page.date) {
        page.dateClass = rows[i].viewDate.split(' ').join('').split('-').join('').split(':').join('');

        var dateData = {
          vars: vars,
          xData: rows[i],
          date: 'date' + page.dateClass
        };
        console.log(dateData);
        renderTmp('#goods_item', 'goodsDateItem', dateData);

      }
      page.date = rows[i].viewDate;
      var itemData = {
        vars: vars,
        xData: rows[i]
      };
      renderTmp('.date' + page.dateClass, 'goodsItem', itemData);
    }
  });
}